Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct x chain bridging #704

Closed
wants to merge 2 commits into from
Closed

Direct x chain bridging #704

wants to merge 2 commits into from

Conversation

dimpar
Copy link
Contributor

@dimpar dimpar commented Sep 29, 2023

Refs https://github.com/keep-network/tbtc-v2/blob/5c2ec02226761ab4ddee3a5c773fef6346f02003/docs/rfc/rfc-10.adoc#rfc-9-solana-tbtc

This PR aims to draft functionality for direct cross-chain deposits and redemption of TBTC. The first couple of commits revolve around the Base chain for simplicity and just show how the dots might be connected. However, the flow should be very similar for other EVM and non-EVM chains. More generic implementation should be considered in further commits to lay the ground for other chains.

Here are the building blocks:

  • cross-chain/base/BaseGateway.sol This contract is deployed on the Base chain and triggers the on-chain flow for reveal and redemption functionality.

  • BaseGateway calls Automatic Wormhole Relayer contract to facilitate the delivery of Verifiable Action Approvals (VAAs) to recipient contracts. Addresses of the Relayer contract for the Base chain can be found here

  • Off-chain Wormhole Guardian Network that calls receiveWormholeMessages() on the receiving end.

  • solidity/cross-chain/BaseDepositor.sol - this contract is deployed on Ethereum and it receives the reveal params from L2 and then triggers the tBTC bridge.reveal() flow

  • solidity/cross-chain/BaseRedeemer.sol - this contract is deployed on Ethereum and it receives the redemption params from L2 and then triggers the tBTC bridge.requestRedemption() flow

  • tBTC relayer / bot To make a seamless user experience there should be implemented a tTBC relayer that listens to on-chain events and acts accordingly.

Once the reveal flow is complete and TBTC is minted on Ethereum, then the tBTC relayer can trigger the same flow as is available in the Wormhole Portal. With a minted TBTC on Ethereum it can call the existing L2WormholeGateway.receiveTbtc() available on Base. TBTC on Ethereum will be locked and the canonical TBTC will be minted on Base for a user who initiated BTC bridging.

When going back from L2->L1 (e.g. redemption flow) the L2WormholeGateway.sendTbtc() should be called on Base. The BaseRedeemer.sol should trigger the tTBTC redemption flow.

This contract will be deployed on Base chain. It can trigger the reveal
flow and redemption flow on Ethereum chain.
These two contracts will be on the receiving end of the reveal and
redemption flow. Once the data is sent cross-chain from the BaseGateway,
these contracts will receive all the required params to pass it to tBTC
bridge.
@lukasz-zimnoch
Copy link
Member

This is an exploratory work that will be used to develop production-grade code on top of it. Closing in favor of #750

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants